<?php

namespace App\Service\Auth\v1_3_3;

use App\Model\NickNamePool;
use App\Model\UserProfile;
use App\Service\BaseService;

/**
 * 随机选取昵称
 */
class PickNickService extends BaseService
{
    public function handle()
    {
        $userId = $this->getUserId();
        $userProfile = UserProfile::getProfile($userId);
        $rqGender = $this->request->input('gender', -1);
        $gender = $rqGender>-1 ? $rqGender : $userProfile->gender;
        $ret = NickNamePool::pickNickName($gender);
        return $ret;
    }
}
